package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

public class ServiceEndpointsItem implements Sequenceable, Serializable {

    @SerializedName("commandMetadata")
    private CommandMetadata commandMetadata;

    @SerializedName("clickTrackingParams")
    private String clickTrackingParams;

    @SerializedName("signalServiceEndpoint")
    private SignalServiceEndpoint signalServiceEndpoint;

    @SerializedName("subscribeEndpoint")
    private SubscribeEndpoint subscribeEndpoint;


    public static final Sequenceable.Producer<ServiceEndpointsItem> CREATOR = new Producer<ServiceEndpointsItem>() {
        @Override
        public ServiceEndpointsItem createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            ServiceEndpointsItem serviceEndpointsItem = new ServiceEndpointsItem();
            serviceEndpointsItem.unmarshalling(parcel);
            return serviceEndpointsItem;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeSequenceable(this.commandMetadata);
        parcel.writeString(this.clickTrackingParams);
        parcel.writeSequenceable(this.signalServiceEndpoint);
        parcel.writeSequenceable(this.subscribeEndpoint);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        parcel.readSequenceable(this.commandMetadata);
        this.clickTrackingParams=parcel.readString();
        parcel.readSequenceable(this.signalServiceEndpoint);
        parcel.readSequenceable(this.subscribeEndpoint);
        return true;
    }

    @Override
    public String toString() {
        return "ServiceEndpointsItem{" +
                "commandMetadata=" + commandMetadata +
                ", clickTrackingParams='" + clickTrackingParams + '\'' +
                ", signalServiceEndpoint=" + signalServiceEndpoint +
                ", subscribeEndpoint=" + subscribeEndpoint +
                '}';
    }

    public CommandMetadata getCommandMetadata() {
        return commandMetadata;
    }

    public void setCommandMetadata(CommandMetadata commandMetadata) {
        this.commandMetadata = commandMetadata;
    }

    public String getClickTrackingParams() {
        return clickTrackingParams;
    }

    public void setClickTrackingParams(String clickTrackingParams) {
        this.clickTrackingParams = clickTrackingParams;
    }

    public SignalServiceEndpoint getSignalServiceEndpoint() {
        return signalServiceEndpoint;
    }

    public void setSignalServiceEndpoint(SignalServiceEndpoint signalServiceEndpoint) {
        this.signalServiceEndpoint = signalServiceEndpoint;
    }

    public SubscribeEndpoint getSubscribeEndpoint() {
        return subscribeEndpoint;
    }

    public void setSubscribeEndpoint(SubscribeEndpoint subscribeEndpoint) {
        this.subscribeEndpoint = subscribeEndpoint;
    }
}
